#ifndef __UPDATE_H__
#define __UPDATE_H__
#include "type.h"
#define UART_CMD_INDEX      0x00
#define UART_CMD_LENGTH     0x01

#define I2C_CMD_INDEX       0x00
#define I2C_CMD_LENGTH      0x01

#define UART_GET_SYSTEM_VERSION_CMD_LENGTH   0x02

typedef enum uart_update_cmd
{
    UART_GET_SYSTEM_VERSION_CMD                 = 0x01,
    UART_ENTER_SYSTEM_UPDATE_MODE_CMD           = 0x02,
    UART_GET_SYSTEM_FILE_SIZE_CMD               = 0x03,
    UART_RECEIVE_SYSTEM_UPDATE_CMD              = 0x04,
    UART_COMPLETE_SYSTEM_UPDATE_CMD             = 0x05,
    UART_OPEN_LOCK_CMD                          = 0x06,
    UART_CLOSE_LOCK_CMD                         = 0x07,

}MI_UartUpdateCmd;


typedef enum i2c_update_cmd
{
    I2C_GET_SYSTEM_VERSION_CMD                 = 0x01,
    I2C_ENTER_SYSTEM_UPDATE_MODE_CMD           = 0x02,
    I2C_GET_SYSTEM_FILE_SIZE_CMD               = 0x03,
    I2C_RECEIVE_SYSTEM_UPDATE_CMD              = 0x04,
    I2C_COMPLETE_SYSTEM_UPDATE_CMD             = 0x05, 

}MI_I2cUpdateCmd;

MI_BOOL send_i2c_message(MI_U8 *p_buff,MI_U32 len);
void handle_usart2_message(uint8_t *p_buf,int len);
MI_BOOL handle_i2c_message(MI_U8 *p_buff,MI_U32 len);

void handle_spi1_message(uint8_t *p_buf,int len);
#endif